<template name="elements_event_table">
    <br>
    <input type="text" class="filter-transactions" placeholder="{{i18n 'wallet.events.filter'}}">
    <table class="dapp-zebra transactions">
        <tbody>
            {{#each items}}
                {{> elements_events_row}}
            {{else}}
                <tr class="full-width">
                    <td colspan="3">
                        {{i18n "wallet.transactions.noneFound"}}
                    </td>
                </tr>
            {{/each}}

            {{#if hasMore}}
                <tr>
                    <td colspan="6">
                        <button class="show-more">{{i18n "wallet.transactions.showMore"}}</button>
                    </td>
                </tr>
            {{/if}}
        </tbody>
    </table>
</template>

<template name="elements_events_row">
    <tr class="{{#if $eq unConfirmed.confirmations 0}}unconfirmed{{/if}} {{#if disabled}}disabled{{/if}}" data-transaction-hash="{{transactionHash}}" data-block-hash="{{blockHash}}">
        {{#with unConfirmed}}
            <div class="dapp-progress">
                <div class="dapp-bar" style="width: {{percent}}%;"></div>
            </div>
        {{/with}}
        <td class="time simptip-position-right simptip-movable" data-tooltip="{{formatTime timestamp 'LLLL'}}">
            <h2>{{formatTime timestamp "MMM"}}</h2>
            <p>{{formatTime timestamp "D"}}</p>
        </td>
        <td class="account-name">
            <h2>  
                {{#if this.event }} 
                    {{{toSentence this.event}}}
                {{else}}
                    {{i18n "wallet.transactions.types.executeContract"}}
                {{/if}}
            </h2>
            
            <p style="word-break: break-word;">
                {{#each returnValues}}
                    {{{toSentence name}}}: <strong>{{value}}</strong> <br>
                {{/each}}
            </p>
            
        </td>
        <td class="info">
            {{#with unConfirmed}}
                {{confirmations}} {{i18n "commonWords.of"}} {{totalConfirmations}} {{i18n "wallet.transactions.confirmations"}}
            {{else}}
                {{fromNowTime}}
            {{/with}}
        </td>
    </tr>
</template>

